from PIL import ImageGrab
import time
class tinyshopall:
    def __init__(self,st):
        self.op = st
    def set(self,li):
        self.op.find_element_by_xpath("//input[@name='other_currency_symbol']").clear()
        self.op.find_element_by_xpath("//input[@name='other_currency_symbol']").send_keys(li[0])
        self.op.find_element_by_xpath("//input[@name='other_currency_unit']").clear()
        self.op.find_element_by_xpath("//input[@name='other_currency_unit']").send_keys(li[1])
        self.op.find_element_by_xpath("//input[@name='other_tax']").clear()
        self.op.find_element_by_xpath("//input[@name='other_tax']").send_keys(li[2])
        self.op.find_element_by_xpath("//div[@id='content']/div/form/dl[7]/dd/input").clear()
        self.op.find_element_by_xpath("//div[@id='content']/div/form/dl[7]/dd/input").send_keys(li[3])
        self.op.find_element_by_xpath("//input[@name='other_order_delay_flash']").clear()
        self.op.find_element_by_xpath("//input[@name='other_order_delay_flash']").send_keys(li[4])
        self.op.find_element_by_xpath("//input[@name='other_order_delay_group']").clear()
        self.op.find_element_by_xpath("//input[@name='other_order_delay_group']").send_keys(li[5])
        self.op.find_element_by_xpath("//div[@id='content']/div/form/dl[10]/dd/input").clear()
        self.op.find_element_by_xpath("//div[@id='content']/div/form/dl[10]/dd/input").send_keys(li[6])
        self.op.find_element_by_xpath("//input[@name='other_order_delay']").clear()
        self.op.find_element_by_xpath("//input[@name='other_order_delay']").send_keys(li[7])

        self.op.find_element_by_xpath("//div/input").click()

        im = ImageGrab.grab()
        im.save(r'C:\Users\Administrator\Desktop\caseall\pic\%s.jpg'%(li[8]))

        time.sleep(1)
        return self.op
    # def __del__(self):
    #     # pass
    #     time.sleep(3)
    #     self.op.close()
